{include file='/public/index-header'}
<body>
    {include file='/public/index-nav'}
    <div class="layui-container ws-container">
        <div class="layui-row" style="margin: 60px 0px;">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <h3>我的班级</h3>
                    </div>
                    <div class="layui-card-body">
                        <table id="class_list" class="layui-table"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {include file='/public/index-foot'}
</body>

<style type="text/css">

</style>
<script type="text/javascript" >
    $(function () {
        layui.use(['table'], function () {
            let table = layui.table;
            // 渲染
            table.render({
                elem: '#class_list',method:'post',skin: 'nob',css:'.layui-border-box {border: none;}',
                url:'{:sysuri("getlist")}',page:{layout:['count','prev','page','next','skip'], theme:'#1e9fff'},
                // 将原始数据解析成 table 组件所规定的数据格式
                parseData: function(res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.info, //解析提示文本
                        "count": res.data.total, //解析数据长度
                        "data": res.data.item //解析数据列表
                    };
                },
                cols: [[
                    {field:'platform_name', title:'{:lang("所属大学")}', minWidth:200},
                    {field:'teacher_name', title:'{:lang("老师")}', minWidth:200},
                    {field:'class_name', title:'{:lang("班级")}', minWidth:200},
                    {field:'create_at', title:'{:lang("加入时间")}', minWidth:200},
                ]],
                done: function(res, curr, count){
                    $('th').css({'background-color': '#f6f7f9', 'font-weight':'bold'})
                }
            });
        })
    })
</script>